<template>
    <div class="hamburger-wrap" @click="toggleClick">
        <el-icon class="icon">
            <expand v-if="store.getters.sidebarOpened" />
            <fold v-else />
        </el-icon>
    </div>
</template>

<script setup>
import { Expand,Fold } from '@element-plus/icons'
import { computed } from 'vue';
import { useStore } from 'vuex';

const store = useStore()

const toggleClick = () => {
    store.commit('app/triggerSidebarOpened')
}

</script>

<style lang="scss" scoped>
@import '@/styles/variables.scss';
.hamburger-wrap{
  height: 100%;
  display: flex;
  align-items: center;
  transition: background 0.5s;
  &:hover {
    background: rgba(0,0,0,0.1);
  }
}
.icon{
    font-size: 30px;
    color: #{$Hamburger};
    cursor: pointer;
}

</style>